From: Florian Müllner Date: Fri, 13 Feb 2015 09:44:13 +0000 (+0100) Subject: panel: Add function to close the calendar X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1745 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f84addcadc3b4b64845a51de89008ba22133a6d1;p=gnome-shell.git panel: Add function to close the calendar We will soon replace regular menu items in the calendar drop-down with more complex elements. However there will still be items that should close the drop down when activated - rather than making the menu available throughout the hierarchy (and eventually from outside as well when we add the notifications list), have a public method on a global object just like the ubiquitous Main.overview.hide(). https://bugzilla.gnome.org/show_bug.cgi?id=744817 --- diff --git a/js/ui/panel.js b/js/ui/panel.js index eadf399fa..df67e2bf1 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -891,6 +891,18 @@ const Panel = new Lang.Class({ menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); }, + closeCalendar: function() { + let indicator = this.statusArea.dateMenu; + if (!indicator) // calendar not supported by current session mode + return; + + let menu = indicator.menu; + if (!indicator.actor.reactive) + return; + + menu.close(); + }, + set boxOpacity(value) { let isReactive = value > 0;